//package com.umpay.junit.test;
//
//import static junit.framework.Assert.assertEquals;
//import static junit.framework.Assert.assertNotNull;
//import static org.springframework.test.util.AssertionErrors.fail;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
//import org.junit.Before;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.mock.web.MockHttpServletRequest;
//import org.springframework.mock.web.MockHttpServletResponse;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//import org.springframework.web.servlet.ModelAndView;
//
//import com.umfwechat.h5.controller.TestController;
//import com.umfwechat.h5.controller.cashier.CashierController;
//import com.umfwechat.lightprogram.controller.MerchantController;
//import net.sf.json.JSONObject;
//
///**
// * Created by hopeone on 2017/5/11.
// */
//
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath*:spring-context.xml"})
//public class JunitMerchantController {
//
//    @Resource
//    TestController ttestController;
//    
//    @Resource
//    MerchantController merchantController;
//
//    private MockHttpServletRequest request;
//    private MockHttpServletResponse response;
//
//    static{
//    	/**
//    	 * 
//    	 */
//    	System.setProperty("resin.home", "D:\\install\\resin-4.0.48-SAAS");
//    }
//
//
//    @Before
//    public void before()
//    {
//    	/**
//    	 * 设置resin_home环境变量
//    	 */
//        request = new MockHttpServletRequest();
//        response = new MockHttpServletResponse();
//        request.setCharacterEncoding("UTF-8");
//    }
//
//    @Test
//    public void test()
//    {
//        //request.setRequestURI("createProduct.htm");
//        //request.setMethod(HttpMethod.POST.name());
//
//        ModelAndView mv = null;
//        try
//        {
//            mv = ttestController.test(request, response);
//        }
//        catch (Exception e)
//        {
//            e.printStackTrace();
//            fail("testToSearchPage failed!");
//        }
//
//        assertNotNull(mv);
//        assertEquals(response.getStatus(), 200);
//    }
//
//    @Test
//    public void jsontest()
//    {
//
//        try
//        {
//        	HttpSession session = null;
//        	HttpServletRequest request =new MockHttpServletRequest();
//        	HttpServletResponse response = new MockHttpServletResponse();
//        	session = request.getSession();
//        	
//        	JSONObject res = merchantController.merchantDetail(session,request,response);
//           System.out.println("res="+res);
//        }
//        catch (Exception e)
//        {
//            e.printStackTrace();
//            fail("testToSearchPage failed!");
//        }
//
//
//        assertEquals(response.getStatus(), 200);
//    }
//}
